package demo2;

// 老师类，继承自 Person 类
class Teacher extends Person {
    /**
     * 打印老师信息
     */
    @Override
    public void printInfo() {
        System.out.println("老师信息:");
        System.out.println("姓名: " + name);
        System.out.println("工号: " + id);
        System.out.println("出勤情况: " + (isPresent ? "出勤" : "缺勤"));
        System.out.println("请假次数: " + leaveCount);
        System.out.println("公假次数: " + officialLeaveCount);
    }
}